package com.xwd.utils;


import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

/**
 * @ClassName PropertiesUtil
 * @Description: com.com.xwd.utils
 * @Auther: xiwd
 * @Date: 2022/2/7 - 02 - 07 - 22:48
 * @version: 1.0
 */
public class PropertiesUtil {
    //properties
    private Properties properties;

    //methods
    public PropertiesUtil(String url){
        this.properties=new Properties();
        InputStream inputStream = PropertiesUtil.class.getClassLoader().getResourceAsStream(url);
        try {
            this.properties.load(inputStream);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public String getProperty(String key){
        return this.properties.getProperty(key);
    }
}
